﻿using J.Status.Application.Command.RoomTypeCommand;
using J.StatusModel;
using MediatR;
using StatusService;

namespace J.Status.Application.Handler.RoomTypeHandler
{
    public class RoomTypeFindHandler : IRequestHandler<RoomTypeFindCommand, RoomTypeModel>
    {
        private readonly IRoomTypeService roomTypeService;

        public RoomTypeFindHandler(IRoomTypeService roomTypeService)
        {
            this.roomTypeService = roomTypeService;
        }

        public async Task<RoomTypeModel> Handle(RoomTypeFindCommand request, CancellationToken cancellationToken)
        {
            return await roomTypeService.FindRoomType(request.id);
        }
    }
}
